package com.qww;

import static net.mindview.util.Print.print;

public class Exec04 {
    public static void main(String[] args) {
        Vehicle vehicle1 = new Vehicle();
        vehicle1.distance = 50;
        vehicle1.time = 0.5;
        // 车辆行驶的平均速度 单位：km/h
        double velocity = vehicle1.computeVelocityByDistanceAndTime(vehicle1.distance, vehicle1.time);
        print("d=" + vehicle1.distance + "km, t=" + vehicle1.time + "h, v=" + velocity + "km/h");
    }

}
class Vehicle {
    double distance;  // 车辆行驶路程 单位：km
    double time;  // 车辆行驶时间 单位：hour

    public double computeVelocityByDistanceAndTime(double d, double t) {
        return d / t;
    }
}